package com.wugui.datax.admin.controller;

import com.wugui.datax.admin.core.util.JacksonUtil;
import com.wugui.datax.admin.entity.LoginUser;
import com.wugui.datax.admin.service.LdapService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api")
public class LdapController {

    @Autowired
    private LdapService ldapService;

    @GetMapping("/ldapLogin")
    public Object ldapLogin(@RequestParam(required = true) String userName,@RequestParam(required = true)String password) {
        return ldapService.ldapLogin( userName, password);
    }


 /*   @GetMapping("/ldapLogin")
    public Object ldapLogin( @RequestBody(required = true) String data) {
        LoginUser loginUser = JacksonUtil.readValue(data, LoginUser.class);
        return ldapService.ldapLogin( loginUser.getUsername(), loginUser.getPassword());
    }*/
}
